function selectListOrCalendar(url) {
		window.location.href=url;
}
function clickCheckAll(thisform, enableComment){
	var element;
    for (var i=0;i<thisform.elements.length;i++){
        var e = thisform.elements[i];
        if (e.type == "checkbox" && e.name != "chkAll" && e.disabled != true){
            e.checked = thisform.chkAll.checked;
        }
		element =e;	
    }
	checkAllComments(element, enableComment);
}

function checkAllComments(element, enableComment) {
	if(!element.checked) {
		document.getElementById("chkAll").checked = false;
	}
	if (enableComment) {
		showSelectedComment(element);
	} 
	validateCheckAllBox(element);

}

function showSelectedComment(element) {
	var validate=true;
	for(var i=0;i<element.form.elements.length;i++) {
			var e = element.form.elements[i];
			 if (e.type == "checkbox" && e.name != "chkAll"){
				var number= e.id.split("_")[1];
				if (!e.checked) {
					document.getElementById("chkAll").checked = false;	
					validate = false;
					document.getElementById("reason_"+ number).style.display="none";
				} else {
					document.getElementById("reason_"+ number).style.display="";
				}
            	
        	}
	}
	document.getElementById("chkAll").checked = validate;	
}

function validateCheckAllBox(element) {
	for(var i=0;i<element.form.elements.length;i++) {
			var e = element.form.elements[i];
			 if (e.type == "checkbox" && e.name != "chkAll"){
				if (!e.checked) {
					document.getElementById("chkAll").checked = false;	
					return;
				} 
            	
        	}
	}
	document.getElementById("chkAll").checked = true;	
}

function confirmInfo(info) {
	return confirm(info);
}